#ifndef __UART_DEVICE_H
#define __UART_DEVICE_H

#include "usart.h"
#include "FreeRTOS.h"
#include "semphr.h"
#include "queue.h"

typedef struct UART_Data {
	UART_HandleTypeDef *handle;
	SemaphoreHandle_t xSemaphoreTx;
	xQueueHandle xQueueRx;
	unsigned char rxDatas[10];
}UARTData, *PUARTData;

typedef struct UART_Device {
	char *name;
	int (*Init)(struct UART_Device *ptDev);
	int (*Send)(struct UART_Device *ptDev, unsigned char *buf, int len, int timeoutMS);
	int (*Recv)(struct UART_Device *ptDev, unsigned char *data, int timeoutMS);
	PUARTData privData;//void *privData;
}UARTDevice, *PUARTDevice;

PUARTDevice GetUARTDevice(char *name);

#endif /* __UART_DEVICE_H */

